package cate.game.role.res.guild.boss.msg;

import cate.common.annotation.OperationSetter;
import cate.common.table.d.GDOperation;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdGuild;
import cate.game.role.res.guild.po.GuildPO;


@ClientMsg(title = "公会boss之buff购买 の 请求")
@OperationSetter(value = GDOperation.GUILD_BOSS_BUY_BUFF)
public class GuildBossBuffBuyReq implements MsgInput {

    @Override
    public MsgConfig conf() {
        return MsgIdGuild.BOSS_BUFF_BUY_REQ;
    }

    @Override
    public void execute(GameBody game, ClientContext cc) {

        GuildPO guild = game.res.guild.getGuild(cc.getRole().getRes().guild.uid);
        if (guild == null) {
            game.notice.message(cc.getRole(), 310450, "尚未加入公会");
            return;
        }
        guild.boss.buyBuff(cc.getRole());
    }
}
